home *** CD-ROM | disk | FTP | other *** search
- /* memory manager:
- public interface definition
- by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
- Copyright 1987 - 1991 Apple Computer, Inc. All rights reserved. */
-
- #ifndef memoryDebuggingIncludes
- #define memoryDebuggingIncludes
-
- #ifndef memoryTypesIncludes
- #include "memory types.h"
- #endif
-
- #ifdef appleInternal
- #ifdef insideLoader
- #define GXInlineCode(x) = {0x303C, 0x0800 + x, 0xA832}
- #else
- #define GXInlineCode(x)
- #endif
- #endif
- #ifndef GXInlineCode
- #define GXInlineCode(x) = {0x7000 + (x), 0xA832}
- #endif
-
- typedef enum {
- checkBlocks = 0x0001, /* check blocks when they are passed to the memory manager */
- checkHeap = 0x0002, /* check the entire gxHeap in every memory routine */
- scrambleBlocks = 0x0004, /* pretend that every movable block in the gxHeap moves every time that they could */
- unloadBlocks = 0x0008 /* unload every block in the heap every time any memory is allocated (overrides scrambleBlocks) */
- } memoryValidationFlags;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- long GetHeapValidation(const gxHeap *source) GXInlineCode(49);
- void SetHeapValidation(gxHeap *target, long flags) GXInlineCode(50);
-
- void ValidateHeap(const gxHeap *target, long flags) GXInlineCode(51);
- void ValidateDirectBlock(const void *block) GXInlineCode(52);
- void ValidateIndirectBlock(const void *block) GXInlineCode(53);
- void ValidateMasterPointer(const void *masterPointer) GXInlineCode(54);
- void ValidateBlockRange(const void *rangeStart, long length) GXInlineCode(55);
-
- void *GetDebugMessageHandler(void) GXInlineCode(67);
- void SetDebugMessageHandler(void (*newHandler)(const char *msg, long data)) GXInlineCode(68);
-
- #if defined(appleInternal) && !defined(debugging)
- #define UnscrambleMaster(x) (x)
- #else
- void *UnscrambleMaster(const void *masterPtr) GXInlineCode(56);
- #endif
- #if !defined(noObsoleteMacros) && defined(appleInternal)
- #ifdef debugging
- #define MasterFlip(x) UnscrambleMaster(x)
- #else
- #define MasterFlip(x) (x)
- #endif
- #endif
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #undef GXInlineCode
-
- #endif
-